\hypertarget{classcalico_1_1sensors_1_1OpenCv8Model}{}\doxysection{calico\+::sensors\+::Open\+Cv8\+Model Class Reference}
\label{classcalico_1_1sensors_1_1OpenCv8Model}\index{calico::sensors::OpenCv8Model@{calico::sensors::OpenCv8Model}}


{\ttfamily \#include $<$camera\+\_\+models.\+h$>$}



Inheritance diagram for calico\+::sensors\+::Open\+Cv8\+Model\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=226pt]{classcalico_1_1sensors_1_1OpenCv8Model__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for calico\+::sensors\+::Open\+Cv8\+Model\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=226pt]{classcalico_1_1sensors_1_1OpenCv8Model__coll__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1OpenCv8Model_acbe83ddebe10b7293a4e995430dcac8e}\label{classcalico_1_1sensors_1_1OpenCv8Model_acbe83ddebe10b7293a4e995430dcac8e}} 
\mbox{\hyperlink{classcalico_1_1sensors_1_1OpenCv8Model}{Open\+Cv8\+Model}} \& {\bfseries operator=} (const \mbox{\hyperlink{classcalico_1_1sensors_1_1OpenCv8Model}{Open\+Cv8\+Model}} \&)=default
\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1OpenCv8Model_ab39ea54fd42e21ef5341d4fe3a31b886}\label{classcalico_1_1sensors_1_1OpenCv8Model_ab39ea54fd42e21ef5341d4fe3a31b886}} 
\mbox{\hyperlink{namespacecalico_1_1sensors_a1eaf57959273c4ea8dc8899a2e724a2f}{Camera\+Intrinsics\+Model}} \mbox{\hyperlink{classcalico_1_1sensors_1_1OpenCv8Model_ab39ea54fd42e21ef5341d4fe3a31b886}{Get\+Type}} () const final
\begin{DoxyCompactList}\small\item\em Getter for camera model type. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1OpenCv8Model_aea73193a91b42a0470a8f2f309d9af1f}\label{classcalico_1_1sensors_1_1OpenCv8Model_aea73193a91b42a0470a8f2f309d9af1f}} 
int \mbox{\hyperlink{classcalico_1_1sensors_1_1OpenCv8Model_aea73193a91b42a0470a8f2f309d9af1f}{Number\+Of\+Parameters}} () const final
\begin{DoxyCompactList}\small\item\em Getter for the number of parameters for this camera model. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$typename T $>$ }\\static absl\+::\+Status\+Or$<$ Eigen\+::\+Vector2$<$ T $>$ $>$ \mbox{\hyperlink{classcalico_1_1sensors_1_1OpenCv8Model_a4740ff63eef29b5266ba111dce582bc1}{Project\+Point}} (const Eigen\+::\+VectorX$<$ T $>$ \&intrinsics, const Eigen\+::\+Vector3$<$ T $>$ \&point)
\item 
{\footnotesize template$<$typename T $>$ }\\static absl\+::\+Status\+Or$<$ Eigen\+::\+Vector3$<$ T $>$ $>$ \mbox{\hyperlink{classcalico_1_1sensors_1_1OpenCv8Model_ae457ea890027858b20ff4f85eb69c0b7}{Unproject\+Pixel}} (const Eigen\+::\+VectorX$<$ T $>$ \&intrinsics, const Eigen\+::\+Vector2$<$ T $>$ \&pixel, int max\+\_\+iterations=30)
\end{DoxyCompactItemize}
\doxysubsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1OpenCv8Model_a406682db312ac4f0dbfec0e881c19735}\label{classcalico_1_1sensors_1_1OpenCv8Model_a406682db312ac4f0dbfec0e881c19735}} 
static constexpr int {\bfseries k\+Number\+Of\+Parameters} = 11
\item 
\mbox{\Hypertarget{classcalico_1_1sensors_1_1OpenCv8Model_a1d40ef0c90d4c019c7582530792794cb}\label{classcalico_1_1sensors_1_1OpenCv8Model_a1d40ef0c90d4c019c7582530792794cb}} 
static constexpr \mbox{\hyperlink{namespacecalico_1_1sensors_a1eaf57959273c4ea8dc8899a2e724a2f}{Camera\+Intrinsics\+Model}} {\bfseries k\+Model\+Type} = \mbox{\hyperlink{namespacecalico_1_1sensors_a1eaf57959273c4ea8dc8899a2e724a2faf69e1df9c2c0e23b808833cf5d08984f}{Camera\+Intrinsics\+Model\+::k\+Open\+Cv8}}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
8-\/parameter Brown-\/\+Conrady projection model as presented in Open\+CV. This model assumes an isotropic pinhole model, i.\+e. $fx == fy = f$.~\newline
Parameters are in the following order\+: $[f, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6]$~\newline
~\newline
See the \href{https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html}{\texttt{ Open\+CV documentations page}} for more details. 

\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classcalico_1_1sensors_1_1OpenCv8Model_a4740ff63eef29b5266ba111dce582bc1}\label{classcalico_1_1sensors_1_1OpenCv8Model_a4740ff63eef29b5266ba111dce582bc1}} 
\index{calico::sensors::OpenCv8Model@{calico::sensors::OpenCv8Model}!ProjectPoint@{ProjectPoint}}
\index{ProjectPoint@{ProjectPoint}!calico::sensors::OpenCv8Model@{calico::sensors::OpenCv8Model}}
\doxysubsubsection{\texorpdfstring{ProjectPoint()}{ProjectPoint()}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
static absl\+::\+Status\+Or$<$Eigen\+::\+Vector2$<$T$>$ $>$ calico\+::sensors\+::\+Open\+Cv8\+Model\+::\+Project\+Point (\begin{DoxyParamCaption}\item[{const Eigen\+::\+VectorX$<$ T $>$ \&}]{intrinsics,  }\item[{const Eigen\+::\+Vector3$<$ T $>$ \&}]{point }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}

Returns projection $\mathbf{p}$, a 2-\/D pixel coordinate such that \[ \mathbf{p} = \left[\begin{matrix}f&0\\0&f\end{matrix}\right]\mathbf{p}_d + \left[\begin{matrix}c_x\\c_y\end{matrix}\right]\\ \mathbf{p}_d = s\mathbf{p}_m + \left(2\mathbf{p}_m{\mathbf{p}_m}^T + r^2\mathbf{I}\right) \left[\begin{matrix}p_2\\p_1\end{matrix}\right]\\ s = \frac{1 + k_1r^2 + k_2r^4 + k_3r^6}{1 + k_4r^2 + k_5r^4 + k_6r^6}\\ r^2 = {\mathbf{p}_m}^T\mathbf{p}_m\\ \mathbf{p}_m = \left[\begin{matrix}t_x / t_z\\t_y/t_z\end{matrix}\right]\\ \] {\ttfamily intrinsics} is a vector of intrinsics parameters the following order\+: $[f, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6]$~\newline
~\newline
{\ttfamily point} is the location of the feature resolved in the camera frame $\mathbf{t}^s_{sx} = \left[\begin{matrix}t_x&t_y&t_z\end{matrix}\right]^T$. \mbox{\Hypertarget{classcalico_1_1sensors_1_1OpenCv8Model_ae457ea890027858b20ff4f85eb69c0b7}\label{classcalico_1_1sensors_1_1OpenCv8Model_ae457ea890027858b20ff4f85eb69c0b7}} 
\index{calico::sensors::OpenCv8Model@{calico::sensors::OpenCv8Model}!UnprojectPixel@{UnprojectPixel}}
\index{UnprojectPixel@{UnprojectPixel}!calico::sensors::OpenCv8Model@{calico::sensors::OpenCv8Model}}
\doxysubsubsection{\texorpdfstring{UnprojectPixel()}{UnprojectPixel()}}
{\footnotesize\ttfamily template$<$typename T $>$ \\
static absl\+::\+Status\+Or$<$Eigen\+::\+Vector3$<$T$>$ $>$ calico\+::sensors\+::\+Open\+Cv8\+Model\+::\+Unproject\+Pixel (\begin{DoxyParamCaption}\item[{const Eigen\+::\+VectorX$<$ T $>$ \&}]{intrinsics,  }\item[{const Eigen\+::\+Vector2$<$ T $>$ \&}]{pixel,  }\item[{int}]{max\+\_\+iterations = {\ttfamily 30} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}

Inverts the projection model $\mathbf{P}$ to obtain the bearing vector $\mathbf{p}_m$ of the pixel location $\mathbf{p}$. No closed form solution is available, so we use Newton\textquotesingle{}s method to invert the projection model.~\newline
~\newline
{\ttfamily intrinsics} is a vector of intrinsics parameters the following order\+: $[f, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6]$~\newline
~\newline
{\ttfamily max\+\_\+iterations} specifies the maximum number of Newton steps to take. Optimization will stop automatically if the error is less than 1e-\/14.~\newline
~\newline
{\bfseries{Note\+: This implementation produces superior results for high distortions compared to \href{https://docs.opencv.org/3.4/da/d54/group__imgproc__transform.html\#ga55c716492470bfe86b0ee9bf3a1f0f7e}{\texttt{ Open\+CV\textquotesingle{}s implementation}}. If your application requires numerical precision, it is recommend that you use this one.}} 

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
calico/sensors/camera\+\_\+models.\+h\end{DoxyCompactItemize}
